<template>
  <!-- 实名认证 -->
  <view class="realNameInfo">
    <view class="wrapper">
      <view class="wrapper-item" v-if="userInfo.userImage">
        <view class="label-item">证件照:</view>
        <image class="photo-class" :src="imgPrefix + userInfo.userImage"
          @click="pvwImage([imgPrefix + userInfo.userImage])" mode="aspectFill">
        </image>
      </view>
      <view class="wrapper-item">
        <view class="label-item">姓名:</view>
        <view class="content-item">{{ userInfo.userName || "" }}</view>
      </view>
      <view class="wrapper-item">
        <view class="label-item">身份证号:</view>
        <view class="content-item">{{ encryptIDCard(userInfo.idCard) || "" }}</view>
      </view>
      <view class="wrapper-item">
        <view class="label-item">人员类型:</view>
        <view class="content-item">{{ roleMap[role] || "" }}</view>
      </view>
      <view class="wrapper-item">
        <view class="label-item">联系方式:</view>
        <view class="content-item">{{ userInfo.mobile || "" }}</view>
      </view>
    </view>
    <yy-watermark></yy-watermark>
  </view>
</template>

<script>
  import {
    AuthenticationDetail
  } from "@/api/home.js";
  import {
    pvwImage,
    encryptIDCard
  } from "@/utils/util.js";

  export default {
    data() {
      return {
        baseImgUrl: this.$baseImgUrl,
        baseURL: this.$baseURL,
        imgPrefix: uni.getStorageSync("imgPrefix"),
        options: {},
        form: {},
        errorType: ["none"],
        userInfo: uni.getStorageSync('user'),
        role: uni.getStorageSync('role'),
        roleMap: {
          'fj': '辅警',
          'wgy': '网格员'
        }
      };
    },
    onLoad(options) {
      this.options = options;
    },
    methods: {
      encryptIDCard,
      pvwImage,
    },
  };
</script>

<style>
  page {
    background-color: #f3f3f3 !important;
    height: 100%;
  }
</style>
<style lang="scss" scoped>
  .realNameInfo {
    flex: 1;
    background-color: #f3f3f3;

    .wrapper {
      width: 718rpx;
      background: #FFFFFF;
      border-radius: 16rpx 16rpx 16rpx 16rpx;
      margin: 0 auto;
      padding: 0 27rpx;
      margin-top: 10rpx;

      .wrapper-item {
        height: 107rpx;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1rpx solid #E4E4E4;

        &:last-child {
          border: 0;
        }

        .label-item {
          font-size: 28rpx;
          color: #7F7E83;
          flex-shrink: 0;
          margin-right: 30rpx;
        }

        .content-item {
          font-weight: bold;
          font-size: 28rpx;
          color: #333333;
        }
      }

      .photo-class {
        width: 90rpx;
        height: 90rpx;
      }
    }
  }
</style>